<?php

namespace App\Http\Requests\Admin\Role;
use App\Http\Requests\Request;

class CreateRequest extends Request{
    public function authorize(){
        return true;
    }
    public function rules(){
        return [
            'name' => 'required|alpha_dash|unique:roles,name',
            'display_name'=>'required',
        ];
    }
    public function messages(){
        return [
            'name.required' => '角色标识必须填写',
            'name.alpha_dash' => '角色仅允许字母、数字、破折号（-）以及底线（_）',
            'name.unique' => '该角色标识已存在',
            'display_name.required'=>'角色名称不能为空！',
        ];
    }
}
